	<script language="javascript">	
		function confirm_del(execute,msg){
			if(confirm("Are you sure you want to delete this "+msg+"?")){
				window.location=execute;
			}else{
				return false;
			}
		}
	</script>
<form action="<?=site_url("classify/save_update_classify/".$ads_data['product_id'])?>" name="" method="post" enctype="multipart/form-data">
<div id="border">   
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td valign="top">       
        <table width="705" border="0" align="center" id="usertitle">
          <tr>
            <td><h3 style="">Classified Ads</h3></td>
            <td align="center"><span class="success_message"><?=$success_message?></span></td>
            <td align="right"><img src="<?=base_url();?>images/Secure_connection.gif" alt="" width="116" height="22" /></td>
          </tr>
        </table>
        <div id="register">
        <div class="user_line_border_top">&nbsp;</div>
        <div><?php if($error_message!=""){?><div class="error_message" style="color:#BD2031; font-size:11px; line-height:20px;"><?=htmlspecialchars($error_message);?></div><? }?></div>                
       <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0">
    	<tr>
        	<td align="right" class="ttd">Category:</td>
            <td height="48">
            	<select id="cbocategory" name="cbocategory" class="textbox">
				  <?php foreach($all_cate->result() as $category): 
                    if($ads_data['classify_id']==$category->classify_id){
                        $selectcbo="selected=/'selected/'";
                    }else{
                         $selectcbo="";
                    }
                  ?>
                  <option value="<?=$category->classify_id;?>" <?=$selectcbo;?> ><?=$category->classify_desc;?></option>
                  <?php endforeach; ?>
                </select>
            </td>
            
        </tr>
        <tr>
        	<td align="right" class="ttd">Title:</td>
            <td height="48"><input type="text" id="txtproductname" name="txtproductname" maxlength="100" value="<?=htmlspecialchars($ads_data['product_name']);?>" class="textbox" /><font color="#FF0000">*</font></td>
        	
        </tr>
        <tr>
        	<td align="right" class="ttd">Description</td>
            <td height="48"><textarea id="txtdesc" name="txtdesc" style="height:190px;width:225px;"><?=htmlspecialchars($ads_data['product_desc']);?></textarea></td>
        	<td></td>
        </tr>
        <tr>
        	<td align="right" class="ttd">Price:</td>
            <td height="48"><input type="text" id="txtprice" name="txtprice" maxlength="8" value="<?=htmlspecialchars($ads_data['price']);?>" class="textbox" />($)<font color="#FF0000">*(number only)</font></td>
        	
        </tr>

        <tr>
        <td></td>
        <td></td>
        </tr>

        <tr>
        	<td align="right" class="ttd">Contact Name:</td>
            <td height="48"><input type="text" id="txtcontactname" name="txtcontactname" maxlength="100" value="<?=htmlspecialchars($ads_data['contact_name']);?>" class="textbox" /></td>
        </tr>
        <tr>
        	<td align="right" class="ttd">Address:</td>
            <td height="48"><input name="txtaddress" type="text" id="txtaddress" value="<?=htmlspecialchars($ads_data['address']);?>" maxlength="110" class="textbox" /></td>
            <td></td>
        </tr>
        <tr>
        	<td align="right" class="ttd">Phone:</td>
            <td height="48"><input type="text" id="txtphone" name="txtphone" maxlength="50" value="<?=htmlspecialchars($ads_data['phone']);?>" class="textbox" /></td>
        	
        </tr>
        <tr>
        	<td align="right" class="ttd">Fax:</td>
            <td height="48"><input type="text" id="txtfax" name="txtfax" maxlength="50" value="<?=htmlspecialchars($ads_data['fax']);?>" class="textbox" /></td>
        	
        </tr>
        <tr>
        	<td align="right" class="ttd">Email:</td>
            <td height="48"><input type="text" id="txtemail" name="txtemail" maxlength="100" value="<?=htmlspecialchars($ads_data['email']);?>" class="textbox" /></td>
          
        </tr>
         <tr>           
            <td align="center"></td>
            <td height="26"><font style="color:#999;">Image format: Jpeg, Jpg, Gif, or Png Size: 3MB</font></td>
        </tr>
        <tr>
          <td align="right" class="ttd" style="line-height:26px;">Image 1:<br />Image 2:<br />Image 3:<br />Image 4:<br />Image 5:</td>
          <td height="48">
          <input type="file" id="image1" name="image1" /><br />

            <input type="file" id="image2" name="image2" /><br />

            <input type="file" id="image3" name="image3" /><br />

            <input type="file" id="image4" name="image4" /><br />
            
            <input type="file" id="image5" name="image5" />
            
        </tr>
        <tr>
            <td></td>
            <td height="48">
            <table border="0">
            	<?php	   	  
				 $str_path = str_replace("\\", "/", FCPATH);
               	 $getimg=$this->m_classify->select_classify_img($ads_data['product_id']);
				   foreach($getimg->result() as $imgname):				  
					  $file_name = current(explode(".", $imgname->img_name));
					  $file_ext  = next(explode(".", $imgname->img_name));
				   	  $filename = $str_path.$ads_data['file_path'].$file_name.".".$file_ext;  
					?>
                    <? if($imgname->img_name<>"" && file_exists ($filename)){ ?>
                    <tr>
                    	<td><img src="<?=base_url();?><?=$ads_data['file_path'];?><?=$imgname->img_name;?>" width="36"/></td>
                        <td><?=$imgname->img_name;?></td>
                        <td><a href="javascript:confirm_del('<?=site_url("classify/delete_one_img/".$ads_data['product_id']."/$imgname->img_id")?>','ads')">delete</a></td>
                    </tr>
                                
                    <?php } 
					 endforeach;?>
                	
              </table>
            </td>
        </tr>
        
        <tr>
        	<td align="center">&nbsp;</td>
        	<td height="48"><input type="button" value="<?=$Z_TRANS->value('title_back')?>" onclick="document.location='javascript:history.back(1)'" style="height:26px;" /> <input type="submit" name="btnsave" value="<?=$Z_TRANS->value('button_update')?>" style="height:26px;" /></td>
        </tr>
  	</table>
        </div>
        </td>
        <td width="254" valign="top">
			<?php include APPPATH."views/templates/common/right_content.php"; ?>
         </td>
         
      </tr>
  </table>
</div>
</form>